import config from './config'

export default function(url,data={},methods='GET') {
   return new Promise((resolve,reject)=> {
      wx.request({
         url:config.host + url,
         data,
         methods,
         header:{
            cookie:'MUSIC_U=0feb389158dffb4e4426ff112135cdce97a360417a90a32896fd81f2204baf78519e07624a9f00539cbb345107ced216167ebf4479e801e8c61913bae346ff0d1065bcdbef80b3c0a0d2166338885bd7; Max-Age=1296000; Expires=Tue, 03 Jan 2023 04:39:01 GMT; Path=/; Domain=.music.163.com; HTTPOnly'
         },
         success: (res)=>{
            resolve(res.data)
         },
         fail: (error)=>{
            reject(error)
         },
      });
   })
}